#!/bin/bash

set -x
export PATH=/opt/gcc-4.4.7-7215-n64-loongson/usr/bin:$PATH
export LD_LIBRARY_PATH=/opt/gcc-4.4.7-7215-n64-loongson/usr/lib:/opt/gcc-4.4.7-7215-n64-loongson/usr/mipsel-redhat-linux/lib:/opt/gcc-4.4.7-7215-n64-loongson/usr/mipsel-redhat-linux/sysroot/lib:/opt/gcc-4.4.7-7215-n64-loongson/usr/mipsel-redhat-linux/sysroot/usr/lib:/opt/gcc-4.4.7-7215-n64-loongson/usr/x86_64-unknown-linux-gnu/mips64el-redhat-linux/lib:$LD_LIBRARY_PATH
set +x
export CROSS_COMPILE=mips64el-redhat-linux-
export ARCH=mips



if [ -z $1 ]; then
  make
# ARCH=$ARCH CROSS_COMPILE=$CROSS_COMPILE

elif [ $1 = "build" ]; then
  make

elif [ $1 = "clean" ]; then
  make clean

elif [ $1 = "dump" ]; then
  ${CROSS_COMPILE}objdump -D -S *.ko > /tmp/dis.txt

fi


